
import React, { useState, forwardRef } from 'react'
import { Button } from "antd";
import BilinIcon from "@common/presentational/BilinIcon";

export const TipPage = forwardRef((props, ref) => {
    const { type = '', message = '成功',
        tipList = [],
        btnText = '确定',
        action = () => { },
        extra = () => { }, } = props;

    return (
        <div className="tip-page-content bilin-web-mobile">
            {type && <BilinIcon className='tip-icon' type={`${type}`} />}
            <div className="tip-message">{message}</div>
            <div className="tip-info">
                {tipList.map(item => {
                    return (
                        <div key={item} className="tip-info-item">{item}</div>
                    );
                })}
            </div>
            <Button type="primary"
                className='button-green'
                onClick={() => action && action()}
            >{btnText}</Button>
            {extra && extra()}
        </div>
    )
})